package com.zxcz.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zxcz.domain.Devices;

public interface DevicesMapper {

	List<Devices> queryDevices();

	int insertDevices(Devices devices);

	int addDevicesIfNotExist(Devices devices);

	int deleteDeviceByUserId(int userId);

	List<Devices> selectDeviceByUserId(int userId);
	
	List<String> selectDidByUserId(int userId);

	Long getTotal(@Param("deviceId") String deviceId, @Param("mac") String mac, @Param("account") String account);

	List<Devices> queryDevicesCondition(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize, 
			@Param("deviceId") String deviceId, @Param("mac") String mac, @Param("account") String account);

	List<Devices> queryUserDevice(@Param("pageNum") int pageNumber, @Param("pageSize") int pageSize, 
			@Param("deviceId") String deviceId, @Param("mac") String mac, @Param("account") String account);

	Long getUserDeviceTotal(@Param("deviceId") String deviceId, @Param("mac") String mac, @Param("account") String account);

	List<Devices> findDevicesLikeDid(String deviceId);

	List<Devices> findDevicesLikeMac(String mac);

	List<Devices> findDevicesLikeUserName(String userName);

	List<Devices> findUserDevicesLikeDid(@Param("deviceId") String deviceId, @Param("account") String account);

	List<Devices> findUserDevicesLikeMac(@Param("deviceId") String mac, @Param("account") String account);

	List<Devices> queryUserDevices(String account);

	int updateDeviceBundling(Devices device);

}
